<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('投票表决')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>
<input type="hidden" th:value="${xiangmuId}" id="xiangmuId">
<input type="hidden" th:value="${xiangmuleixing}" id="xiangmuleixing">

<div th:replace="public/top_vote::top"></div>

<div id="Votelist">

    <div class="primary-title">
        <div style="margin-top:15px;text-align: center;font-size:24px">
            <label  style="margin-left: 20px; ">{{xiangmu.xiangmuname}}</label>
            <span  class="btn btn-success" style="float:right;margin-right:15px;margin-top:10px;"
                   v-on:click="toRefresh()">刷新页面</span>
        </div>
        <div style="text-align: center;font-size:18px">
            <label  style="margin-left: 20px; ">总数： {{total}} 您已勾选： <font color="green">{{tongyishu}}</font> </label>
            <input v-if="!issubmited" type="button" class="btn btn-sm btn-primary" style="width: 60px" value="提交" @click="tosubmit()">
            <input v-if="issubmited" type="button" class="btn btn-sm btn-success" disabled style="width: 60px" value="已提交" @click="tosubmit()">

            <a v-if="issubmited" target="_blank" class='btn btn-info'
               style='width:120px;height:34px;color:#fff !important;'
                :href="'/yuecaikangjunyaowujieguo/qianzibiao?xiangmuid='+xiangmuId+'&xiangmuleixing='+xiangmuleixing+'&userid='+userId">打印签字表</a>
            <a v-if="isallsubmited" target="_blank" class='btn btn-primary'
               style='width:120px;height:34px;color:#fff !important;'
               :href="'/main/yuecaihuizongbiao?xiangmuid='+xiangmuId">查看汇总表</a>
        </div>
        <div style="font-size:18px; align-items: center; justify-content: center">

            <!--            <input type="button" class="btn btn-sm btn-danger" style="margin-right: 10px;float: right" value="全不同意" @click="toVoteAll(0)">-->
            <!--           <input type="button" class="btn btn-sm btn-success" style="margin-right: 10px;float: right" value="提交" @click="toVoteAll(1)">-->
        </div>
    </div>

    <div style="height: 30px"></div>

    <div class="primary-content">

        <div id="List">
        </div>



        <div v-if="!show" style="text-align:center;width:100%;">查无数据</div>

        <div v-if="show" class="my-page-navigation">
            <button class="btn btn-default" v-on:click="SetPageIndex">首页</button>
            <button class="btn btn-default" v-on:click="SetPageIndexPrePage">上一页</button>
            <span v-text="pageIndex + '  /  ' + pageCount"></span>
            <span v-text="'共' + recordCount + '条'"></span>
            <button class="btn btn-default" v-on:click="SetPageIndexNextPage">下一页</button>
            <button class="btn btn-default" v-on:click="SetPageEnd">尾页</button>
            <span>跳到第</span>
            <input type="text" class="form-control" style="width: 80px;display:inline-block;"  v-model="inputPageIndexValue" v-on:keyup.enter="JumpPage">
            <span>页</span>
            <button class="btn btn-default" v-on:click="JumpPage">跳</button>
        </div>

    </div>



</div>

</body>
<style>
    th{
        border:1px solid #e6e6e6;
        line-height: 5vh;
        color:#666666;
        font-size: 16px;
    }
    table {
        border-collapse: collapse;
        width: 100%;
    }
    td {
        padding:5px;
        border:1px solid #e6e6e6;
        font-size: 14px;
    }
    .table-head{padding-right:17px;background-color:#CDCDCD;color:#000;height:100px;}
    .table-body{width:100%; height:350px;overflow-y:scroll;}
    .table-head table,.table-body table{width:100%;}
    .table-body table tr:nth-child(2n+1){background-color:#f2f2f2;}

    .table-body table tr:hover {
        background-color:rgb(240, 249, 228);
        transition: .2s;
    }
</style>
<script th:src="@{/js/vote/list_yuecaikangjun_vote.js?v=1.07}"></script>

<script type="text/javascript">
    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });

    function toVote(ppId){
        var ppResult="";
        if($("#checkbox_"+ppId+"").is(":checked")){
            ppResult="1";
        }else {
            ppResult="0";
        }
        layer.open({type: 3});
        $.post('/yuecaikangjunyaowujieguo/toupiao', {
            id: ppId,
            userid:$("#id").val(),
            result: ppResult,
            rdm: Math.random()
        }, function (ppData) {
            layer.closeAll("loading");
            if (ppData != null) {
                if (ppData.result == "1") {
                    //
                    // if(ppResult=="1"){
                    //     $("#div_"+ppPinzhong+"_"+ppPingui+"").html("<span style=\"color:#008000\">保留</span>");
                    //
                    // }
                    // if(ppResult=="0"){
                    //     $("#div_"+ppPinzhong+"_"+ppPingui+"").html("<span style=\"color:#ff0000\">淘汰</span>");
                    // }
                    vote.getYuecaikangjunResultCount();
                } else {
                    layer.alert(ppData.message);
                    //$("#checkbox_"+ppPinzhong+"_"+ppPingui+"").attr("checked","false")
                    vote.findBiaojuelist();
                }
            }
        }, "json");

    }

</script>
<style>
    a {
        text-decoration: none;
        color:#333;
    }
    /*正常的未被访问过的链接*/
    a:link {
        text-decoration: none;
    }
    /*已经访问过的链接*/
    a:visited {
        text-decoration: none;
    }
    /*鼠标划过(停留)的链接*/
    a:hover {
        text-decoration: none;
    }
    /* 正在点击的链接*/
    a:active {
        text-decoration: none;
    }
</style>
</html>